﻿using AnesSystem.Models;
using AnesSystem.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AnesSystem.ViewModels
{
    public class MenuListViewModel:BaseViewModel<MenuListViewModel>
    {
        private string _value="";

        private List<MenuListModel> _disMenuList;
        public MenuListViewModel()
        {
            _disMenuList = DataManager.Instance.MenuList.ToList().Where(O => O.ClassName.Contains(_value) || O.Fxid.Contains(_value) || O.Name.Contains(_value)).ToList();
        }

        public string Value
        {
            get
            {
                return _value;
            }
            set
            {
                _value = value;
                RaisePropertyChanged("MenuList");
                
            }
        }


        public List<MenuListModel> MenuList
        {
            get
            {
                return DataManager.Instance.MenuList.ToList().Where(O => O.ClassName.Contains(_value) || O.Fxid.Contains(_value) || O.Name.Contains(_value)).ToList();
            }
            set
            {
                DataManager.Instance.MenuList = value;
                RaisePropertyChanged("MenuList");
            }
        }
    }
}
